<template>
  <div >
    <el-container style="height: 677px; margin-top: 10px;border: 1px solid #eee;border-radius: 1% 1% 1% 1%">
      <el-aside width="200px" style="background-color: rgb(238, 241, 246)">
        <el-menu :default-openeds="['1']">
          <el-submenu index="1">
            <template  slot="title"><i class="el-icon-message"></i>系统管理</template>
            <el-menu-item-group>
              <template slot="" ></template>
              <router-link to="/indexadmin/userview" tag="span"><el-menu-item index="1-1" >用户管理</el-menu-item></router-link>

              <el-menu-item index="1-2">角色管理</el-menu-item>
              <el-menu-item index="1-3">菜单管理</el-menu-item>
            </el-menu-item-group>
          </el-submenu>
          <el-submenu index="2">
            <template slot="title"><i class="el-icon-menu"></i>导航二</template>
            <el-menu-item-group>
              <el-menu-item index="2-1">选项1</el-menu-item>
              <el-menu-item index="2-2">选项2</el-menu-item>
              <el-menu-item index="2-3">选项3</el-menu-item>
            </el-menu-item-group>
          </el-submenu>

        </el-menu>
      </el-aside>

      <el-container>
        <el-header style="text-align: right; font-size: 12px">

          <span >{{ username }}</span>
          &nbsp;          &nbsp;          &nbsp;
           <el-button type="danger" icon="el-icon-user" @click="logout"  circle></el-button>
        </el-header>
        <el-main>
          <router-view></router-view>
        </el-main>
        <el-footer style="height: 35px;text-align: right;font-size: 12px" >© 2501 Java2501ByTaotie Copyright</el-footer>

      </el-container>
    </el-container>
  </div>
</template>

<script>
import {mapState} from "vuex";

export default {
  name:'IndexAdmin',
  data(){
    return{

    }
  },
  computed:{
    ...mapState(["username"])
  },
  methods:{
    toUserView(){
      // this.$router.push("/indexadmin/userview")
    },
    logout(){
      this.$store.commit("saveUsername","")
      this.$router.push("/")
      this.$message.success("退出成功")
    }
  }
}
</script>

<style scoped>
.el-header {
  background-color: #B3C0D1;
  color: #333;
  line-height: 60px;
}

.el-aside {
  color: #333;
}
</style>
